from google.appengine.api import users
from google.appengine.ext import db
from app.models import DataSet, FieldSet, ValueSet, ValueSetInterface
from app.helpers import properties as props

import uuid, random, time


class Scenario(object):
  def __init__(self):
    self.user = users.User('a@b.com', 'b.com')
    self.dataset = DataSet.create(name=str(time.time()), owner=self.user)
    self.primary_fieldset = FieldSet.create(self.dataset.key(), 'UUID', 
      props.NameProperty(name='name', verbose_name="Surname, Given Name"),
      props.EmailProperty(verbose_name="Email"),
      props.PhoneNumberProperty(verbose_name="Phone Number"))
    self.tags_fieldset = FieldSet.create(self.dataset.key(), 'Tags',
      props.KeyStringListProperty(verbose_name='Skills'),
      props.KeyStringListProperty(verbose_name='Interests'))
    self.cat_fieldset = FieldSet.create(self.dataset.key(), 'Categories',
      props.KeyStringProperty(verbose_name='Neighborhood'),
      props.KeyStringProperty(verbose_name='Favorite Color'))
  
  def get_interface(self):
    return ValueSetInterface(self.user, self.dataset)


